<h3 class="page-title">公告系统
    <small>Announcements System</small>
</h3>
<ul class="breadcrumb">
    <li>
        <i class="icon-home"></i>
        <a href="javascript:;" ui-sref="index.home">首页</a>
        <i class="icon-angle-right"></i>
    </li>
    <li>
        <a href="javascript:;">公告系统</a>
        <i class="icon-angle-right"></i>
    </li>
    <li>
        <a href="javascript:;" ui-sref="index.addNotice">添加公告</a>
    </li>
    <li class="pull-right no-text-shadow">
        {{utc}} UTC
    </li>
</ul>

<div class="portlet box red ">

    <div class="portlet-title">

        <div class="caption"><i class="icon-reorder"></i>发布公告</div>

        <div class="tools">

            <a href="javascript:;" class="collapse"></a>

            <a href="#portlet-config" data-toggle="modal" class="config"></a>

            <a href="javascript:;" class="reload"></a>

            <a href="javascript:;" class="remove"></a>

        </div>

    </div>

    <div class="portlet-body form">

        <!-- BEGIN FORM-->

        <form class="form-horizontal form-bordered">

            <div class="control-group">
                <label class="control-label">公告标题</label>
                <div class="controls">
                    <input type="text" placeholder="请输入公告标题" ng-model="title" class="m-wrap span12">
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">公告类型</label>
                <div class="controls">
                    <select class="span12 m-wrap" ng-model="type">
                        <option value="-1">-- 请选择公告类型 --</option>
                        <option ng-repeat="(key,value) in types" value="{{key}}">{{value}}</option>
                    </select>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">内容</label>
                <div class="controls">
                    <div id="editor"></div>
                </div>
            </div>

            <div class="control-group">
                <label class="control-label">上传附件</label>
                <div class="controls">

                        <noscript><input type="hidden" name="redirect" value="http://blueimp.github.com/jQuery-File-Upload/"></noscript>

                        <div class="row-fluid fileupload-buttonbar">

                            <div class="span7">

                                <span class="btn green fileinput-button">
									<i class="icon-plus icon-white"></i>
									<span>添加文件...</span>
									<input type="file" id="fileupload" name="files[]" multiple>
									</span>

                                <button type="reset" class="btn yellow cancel">
                                    <i class="icon-ban-circle icon-white"></i>
                                    <span>取消上传</span>
                                </button>

                            </div>

                            <div class="span5 fileupload-progress fade">

                                <!-- The global progress bar -->

                                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">

                                    <div class="bar" style="width:0%;"></div>

                                </div>

                                <!-- The extended global progress information -->

                                <div class="progress-extended">&nbsp;</div>

                            </div>

                        </div>

                        <!-- The loading indicator is shown during file processing -->

                        <div class="fileupload-loading"></div>
                        <br>

                    <table role="presentation" class="table table-striped">
                        <tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody>
                    </table>


                </div>
            </div>


            <div class="form-actions">
                <button type="button" class="btn blue" ng-click="save()"><i class="icon-ok"></i> 保存</button>
                <button type="button" class="btn">重置</button>
            </div>

        </form>

        <!-- END FORM-->

    </div>

</div>

<script id="template-upload" type="text/x-tmpl">

							{% for (var i=0, file; file=o.files[i]; i++) { %}

							    <tr class="template-upload fade">

							        <td class="preview"><span class="fade"></span></td>

							        <td class="name"><span>{%=file.name%}</span></td>

							        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>

							        {% if (file.error) { %}

							            <td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>

							        {% } else if (o.files.valid && !i) { %}

							            <td>

							                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>

							            </td>

							            <td class="start">{% if (!o.options.autoUpload) { %}

							                <button class="btn">

							                    <i class="icon-upload icon-white"></i>

							                    <span>上传</span>

							                </button>

							            {% } %}</td>

							        {% } else { %}

							            <td colspan="2"></td>

							        {% } %}

							        <td class="cancel">{% if (!i) { %}

							            <button class="btn red">

							                <i class="icon-ban-circle icon-white"></i>

							                <span>取消</span>

							            </button>

							        {% } %}</td>

							    </tr>

							{% } %}

						</script>

<script id="template-download" type="text/x-tmpl">

							{% for (var i=0, file; file=o.files[i]; i++) { %}

							    <tr class="template-download fade">

							        {% if (file.error) { %}

							            <td></td>

							            <td class="name"><span>{%=file.name%}</span></td>

							            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>

							            <td class="error" colspan="2"><span class="label label-important">Error</span> {%=file.error%}</td>

							        {% } else { %}

							            <td class="preview">

							            {% if (file.thumbnail_url) { %}

							                <a class="fancybox-button" data-rel="fancybox-button" href="{%=file.url%}" title="{%=file.name%}">

							                <img src="media/image/{%=file.thumbnail_url%}">

							                </a>

							            {% } %}</td>

							            <td class="name">

							                <a href="{%=file.url%}" title="{%=file.name%}" data-gallery="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>

							            </td>

							            <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>

							            <td colspan="2"></td>

							        {% } %}

							        <td class="delete">

							            <button class="btn red" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"{% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>

							                <i class="icon-trash icon-white"></i>

							                <span>删除</span>

							            </button>

							        </td>

							    </tr>

							{% } %}

						</script>










